package com.bitdf.txing.group.feign.impl.seckill;

import com.bitdf.txing.common.utils.R;
import com.bitdf.txing.product.dao.SkuInfoDao;
import com.bitdf.txing.product.entity.SkuInfoEntity;
import com.bitdf.txing.seckill.feign.SeckillProductFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

/**
 * @author Lizhiwei
 * @date 2023/9/6 8:39:12
 * @description
 */
@Service
@ConditionalOnProperty(value = "tx.deploy.mode", havingValue = "standalone")
public class SeckillProductFeignServiceImpl implements SeckillProductFeignService {
    @Autowired
    SkuInfoDao skuInfoDao;
    @Override
    public R getSkuInfo(Long skuId) {
        SkuInfoEntity skuInfo = skuInfoDao.selectById(skuId);
        return R.ok().put("data", skuInfo);
    }
}
